package cn.itcast.feign;

import cn.itcast.config.FeignConfig;
import cn.itcast.feign.imp.UserFeignClientImpl;
import cn.itcast.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@FeignClient(name = "user-service", fallback = UserFeignClientImpl.class,
        configuration = FeignConfig.class)
public interface UserFeignClient {
    //把访问服务的id 写进来，feign自动帮我们去eureka 中拉取夫妇列表，并选择一个服执行；
    @GetMapping("user/{id}")
    User queryUserById(@PathVariable("id") Long id);
}
